package com.ht.common.core.enums;

import com.ht.common.core.constant.PlatformUserRoleConstants;

/**
 *平台用户角色定义
 * @Author：zmx
 * @Date：2023/12/21 14:12
 */
public enum PlatformUserRoleEnum {
    SYS_MANAGER_ROLE(PlatformUserRoleConstants.SMR,"系统管理员"),
    ENT_MANAGER_ROLE(PlatformUserRoleConstants.FMR,"企业管理员"),
    FIELD_USER_ROLE(PlatformUserRoleConstants.FUR,"场所用户"),
    DECLENT_USER_ROLE(PlatformUserRoleConstants.DEUR,"企业用户"),

    ;
    private String code;
    private String name;

    PlatformUserRoleEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(String code) {
        PlatformUserRoleEnum[] values = PlatformUserRoleEnum.values();
        for (PlatformUserRoleEnum areaEnum : PlatformUserRoleEnum.values()) {
            if (areaEnum.getCode().equals(code)) {
                return areaEnum.getName();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
